import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { 
  UserOutlined, 
  SafetyOutlined, 
  CalendarOutlined, 
  ApartmentOutlined, 
  FileTextOutlined, 
  DollarOutlined, 
  CalculatorOutlined, 
  CreditCardOutlined, 
  UnorderedListOutlined 
} from '@vicons/antd';
import { renderIcon } from '@/utils/index';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/expert-pool',
    name: 'ExpertPool',
    component: Layout,
    meta: {
      title: '专家库管理',
      icon: renderIcon(UserOutlined),
      sort: 1,
      isRoot: true,
      activeMenu: 'expert_pool_index',
    },
    children: [
      {
        path: 'index',
        name: 'expert_pool_index',
        meta: {
          title: '专家库管理',
          activeMenu: 'expert_pool_index',
        },
        component: () => import('@/views/expert-pool/index.vue'),
      },
    ],
  },
  {
    path: '/authorization',
    name: 'Authorization',
    component: Layout,
    meta: {
      title: '授权管理',
      icon: renderIcon(SafetyOutlined),
      sort: 2,
      isRoot: true,
      activeMenu: 'authorization_index',
    },
    children: [
      {
        path: 'index',
        name: 'authorization_index',
        meta: {
          title: '授权管理',
          activeMenu: 'authorization_index',
        },
        component: () => import('@/views/authorization/index.vue'),
      },
    ],
  },
  {
    path: '/meeting-period',
    name: 'MeetingPeriod',
    component: Layout,
    meta: {
      title: '会议时间',
      icon: renderIcon(CalendarOutlined),
      sort: 3,
      isRoot: true,
      activeMenu: 'meeting_period_index',
    },
    children: [
      {
        path: 'index',
        name: 'meeting_period_index',
        meta: {
          title: '会议时间',
          activeMenu: 'meeting_period_index',
        },
        component: () => import('@/views/meeting-period/index.vue'),
      },
    ],
  },
  {
    path: '/position-level',
    name: 'PositionLevel',
    redirect: '/position-level/title',
    component: Layout,
    meta: {
      title: '职级管理',
      icon: renderIcon(ApartmentOutlined),
      sort: 4,
    },
    children: [
      {
        path: 'title',
        name: 'position_level_title',
        meta: {
          title: '职称管理',
        },
        component: () => import('@/views/title/index.vue'),
      },
      {
        path: 'rank',
        name: 'position_level_rank',
        meta: {
          title: '职级管理',
        },
        component: () => import('@/views/rank/index.vue'),
      },
    ],
  },
  {
    path: '/template',
    name: 'Template',
    component: Layout,
    meta: {
      title: '模板管理',
      icon: renderIcon(FileTextOutlined),
      sort: 5,
      isRoot: true,
      activeMenu: 'template_index',
    },
    children: [
      {
        path: 'index',
        name: 'template_index',
        meta: {
          title: '模板管理',
          activeMenu: 'template_index',
        },
        component: () => import('@/views/template/index.vue'),
      },
    ],
  },
  {
    path: '/funding-type',
    name: 'FundingType',
    component: Layout,
    meta: {
      title: '经费类型',
      icon: renderIcon(DollarOutlined),
      sort: 6,
      isRoot: true,
      activeMenu: 'funding_type_index',
    },
    children: [
      {
        path: 'index',
        name: 'funding_type_index',
        meta: {
          title: '经费类型',
          activeMenu: 'funding_type_index',
        },
        component: () => import('@/views/funding-type/index.vue'),
      },
    ],
  },
  {
    path: '/tax-rules',
    name: 'TaxRules',
    component: Layout,
    meta: {
      title: '税费规则',
      icon: renderIcon(CalculatorOutlined),
      sort: 7,
      isRoot: true,
      activeMenu: 'tax_rules_index',
    },
    children: [
      {
        path: 'index',
        name: 'tax_rules_index',
        meta: {
          title: '税费规则',
          activeMenu: 'tax_rules_index',
        },
        component: () => import('@/views/tax-rules/index.vue'),
      },
    ],
  },
  {
    path: '/payment-rules',
    name: 'PaymentRules',
    component: Layout,
    meta: {
      title: '支付规则',
      icon: renderIcon(CreditCardOutlined),
      sort: 8,
      isRoot: true,
      activeMenu: 'payment_rules_index',
    },
    children: [
      {
        path: 'index',
        name: 'payment_rules_index',
        meta: {
          title: '支付规则',
          activeMenu: 'payment_rules_index',
        },
        component: () => import('@/views/payment-rules/index.vue'),
      },
    ],
  },
  {
    path: '/operation-logs',
    name: 'OperationLogs',
    component: Layout,
    meta: {
      title: '操作日志',
      icon: renderIcon(UnorderedListOutlined),
      sort: 9,
      isRoot: true,
      activeMenu: 'operation_logs_index',
    },
    children: [
      {
        path: 'index',
        name: 'operation_logs_index',
        meta: {
          title: '操作日志',
          activeMenu: 'operation_logs_index',
        },
        component: () => import('@/views/operation-logs/index.vue'),
      },
    ],
  },
];

export default routes; 
